package com.ruoyi.system.agriculture.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.agriculture.domain.po.AgActivity;
import com.ruoyi.system.agriculture.mapper.AgActivityMapper;
import com.ruoyi.system.agriculture.service.IAgActivityService;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 农业活动Service业务层处理
 */
@Service
public class AgActivityServiceImpl extends ServiceImpl<AgActivityMapper, AgActivity> implements IAgActivityService {
    /**
     * 查询农业活动列表
     * 
     * @param activity 农业活动信息
     * @return 农业活动集合
     */
    @Override
    public List<AgActivity> selectActivityList(AgActivity activity) {
        LambdaQueryWrapper<AgActivity> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.like(activity.getActivityName() != null, AgActivity::getActivityName, activity.getActivityName())
                .eq(activity.getActivityType() != null, AgActivity::getActivityType, activity.getActivityType())
                .eq(activity.getStatus() != null, AgActivity::getStatus, activity.getStatus())
                .like(activity.getResponsiblePerson() != null, AgActivity::getResponsiblePerson, activity.getResponsiblePerson());
        return list(queryWrapper);
    }
} 